<?php
/**
 * algorithms's name:冒泡算法
 * time:2015-11-27
 */
$in = [1,3,5,7,9,4,2,5,7,8,5,4,3,2,7,5,8,9,4,2,1,3,5,7,9,4,2,5,7,8,5,4,3,2,7,5,8,9,4,2,1,3,5,7,9,4,2,5,7,8,5,4,3,2,7,5,8,9,4,2,1,3,5,7,9,4,2,5,7,8,5,4,3,2,7,5,8,9,4,2,1,3,5,7,9,4,2,5,7,8,5,4,3,2,7,5,8,9,4,2];
function showtime() {
	echo microtime() . "\n";
}
function showinInfo($in) {
	echo 'data\'s length: ' . count($in) . "\n";
}
showinInfo($in);
showtime();
for ($i=1; $i < count($in); $i++) { 
	for ($j=1; $j < count($in); $j++) { 
		if ($in[$j] < $in[$j+1]) {
			$t = $in[$j];
			$in[$j] = $in[$j+1];
			$in[$j+1] = $t;
		}
	}
}
showtime();
for ($i=1; $i < count($in); $i++) { 
	echo $in[$i]. ' ';
}
echo "\n";